<?php


namespace SidToken\Model;


use SidToken\Utils\MiningUtil;
use SidToken\Utils\RewardUtil;
use SidToken\Utils\TrxRpc;
use Think\Model;

/**
 * TRX 钱包 转账调用如果出现错误，则记录
 * Class SidTrxErrModel
 * @package SidToken\Model
 */
class SidTrxErrModel extends Model
{
    const STATUS_NOT_SOLVE = 0;
    const STATUS_SOLVE = 1;

    public function saveErr($functionName, $functionParams, $reason = '')
    {
        $data = [
            'function_name' => $functionName,
            'function_params' => json_encode($functionParams),
            'reason' => $reason,
            'status' => self::STATUS_NOT_SOLVE,
            'create_time' => time()
        ];
        return $this->add($data);
    }

    /**
     * 解决问题 //每次解决5个（防止队列过长导致错误）
     */
    public function solveErr()
    {
        return true;
    }
}